package com.zp.util;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringReader;
import java.util.Properties;

/**
 * @author zp
 * @description properties工具类
 * @created 2021/12/1 17:07
 */

public class PropertiesUtil {

    public static Properties load(String propertiesString) {
        Properties properties = new Properties();
        try {
            properties.load(new StringReader(propertiesString));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties;
    }

    public static void main(String[] args) {
        Properties load = load("zp.cloud=111=333=444\nzp.cloud.url1");
        System.out.println(load.getProperty("zp.cloud"));
        System.out.println(load.getProperty("zp.cloud.url"));
    }
}
